<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <span>12</span>
  <script>
    let span = document.createElement('span')
    let span2 = document.querySelector('span')
    span.innerText = '12'
    document.body.appendChild(span)
    // console.log(span.clientWidth, '====')
    setTimeout(() => {
      console.log(getComputedStyle(span2).getPropertyValue('width'), '====');
      
    }, 0)
  </script>
</body>
</html>